package com.cheng.student.dao.mappers;

import com.cheng.student.beans.Student;
import com.cheng.student.beans.StudentFull;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StudentMapper
    extends Transaction
{
    public Student selectStudentByNameNumber(@Param("name") String name, @Param("number")String number);

    //分页查询
    public List<StudentFull> selectStudentFulls(
            @Param("area")String area,
            @Param("gender")String gender,
            @Param("academy")String academy,
            @Param("major")String major,
            @Param("batch")String batch,
            @Param("type")String type,
            @Param("start")int start,
            @Param("rows")int rows);

    //查询上面的分页查询一功能查出来多数据
    public int selectNumbers(
            @Param("area")String area,
            @Param("gender")String gender,
            @Param("academy")String academy,
            @Param("major")String major,
            @Param("batch")String batch,
            @Param("type")String type
    );

    //查询单个studentFull
    public StudentFull selectStudentFull(@Param("name")String name , @Param("number")String number);

    //查询有多少学生
    public int selectNumberOfStudents();

    //查询某个字段下面所有的值
    public List<String> selectValues(@Param("key") String key);

    public int insertStudentFull(StudentFull student);

    //更新学生信息
    public int updateStudentByNameNumber(
            @Param("name")String name,
            @Param("number")String number,
            @Param("key")String key,
            @Param("value")String value
    );
    public int autocommit();

    //删除学生
    public int deleteStudent(
            @Param("name")String name,
            @Param("number")String number
    );

}
